Problem Note 51642: Using a negative array subscript might generate the error "Array subscript out of range"
Error messages similar to the following can be generated when you use a variable that has a negative value as an array subscript:
ERROR: Array subscript out of range at line 4 column 5.
NOTE: The SAS System stopped processing this step because of errors.
The error can occur even if the subscript value is valid.
The example code below results in an incorrect error message:
data _null_;
array pm[-7:0] (1, 1, 1, 1, 1, 1, 1, 1);
i=-1;
x = pm[i];
run;
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Microsoft Windows 8 Enterprise x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Microsoft Windows 8 Pro x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Microsoft Windows 8.1 Enterprise x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Microsoft Windows Server 2003 for x64 | 9.3_M2 | | 9.3 TS1M2 | |
Microsoft Windows Server 2008 for x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Windows 7 Enterprise x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Windows 7 Home Premium x64 | 9.3_M2 | | 9.3 TS1M2 | |
Windows 7 Professional x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Windows 7 Ultimate x64 | 9.3_M2 | | 9.3 TS1M2 | |
Windows Vista for x64 | 9.3_M2 | | 9.3 TS1M2 | |
Linux for x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
Solaris for x64 | 9.3_M2 | 9.4 | 9.3 TS1M2 | 9.4 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> Statements ==> Information ==> ARRAY SAS Reference ==> Statements ==> Information ==> Array Reference
|
Date Modified: | 2013-11-19 15:08:39 |
Date Created: | 2013-11-18 15:08:09 |